home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / games / dcg408up.zip / EXAMPLE / JIMMY.SCR < prev   
Text File  |  1997-02-20  |  7KB  |  202 lines

  1. !
  2. ! Jimmy's Script.  Derived from the adventurer script, but modified to
  3. ! to handle the one character.
  4. !
  5. ! DESCRIPTION:  Jimmy is a young Dwarf.  He lives near a small town 
  6. ! and works at Joe's pub.  He is the player's friend and want's to
  7. ! go have some fun.  His TEXT block shows the following keywords:
  8. !
  9. !  0 : Hello   Hi! What are you up to? Going on a trip?                
  10. !  1 : Default Have I shown you my weapons?  I'm dying to use them!    
  11. !  2 : Weapons In the chest over there.. Let's go do something..       
  12. !  3 : Join    What are we waiting for.. Let's get the weapons..       
  13. !  4 : Chest   I keep the weapons in the chest.  We could get them!    
  14. !  5 : Get     If we go on a quest, we should get them.                
  15. !  6 : Quest   You know.. Go kill some monsters or something..         
  16. !  7 : King    I heard he was missing!  That might be a worthy quest!  
  17. !  8 : Queen   We could go talk to her in the Castle!                  
  18. !  9 : Castle  Where the King and the Queen live!                      
  19. ! 10 : Trip    You're not thinking of leaving without me, are you?     
  20. ! 11 : AdventurIt's a good time of the year to go look for adventure!  
  21. ! 12 : Job     Joe can find another bus boy.  Let's go questing!       
  22. ! 13 : Joe     You know I work at Joe's Pub during the summer!         
  23. ! 14 : Pub     Yes!                                                    
  24. ! 15 : Ship    I don't have one, but the Queen might lend us one!      
  25. !
  26. ! - V0 is TRUE when we've talked before.
  27. ! - V1 is TRUE if we've JOINED the group
  28. !
  29. ! (c) DC Software, 1992
  30. !
  31.  
  32. !------------------------------------------------------------------------!
  33. :@TALK ! START HERE WHEN YOU 'TALK' TO THIS CHARACTER !
  34. !------------------------------------------------------------------------!
  35.  
  36. ! First, say hello.. !
  37.  
  38.   if npc.picture >= 0 then
  39.     view_pcx(  "ANYCONV.PCX" );
  40.     set_frame( "ANYCONV.PCX",  5,  5,  400 - 95, 350 - 95, 0 );
  41.     viewpcx( FRAME, npc);
  42.     set_frame( "ANYCONV.PCX", 10, 100, 10, 10, 0 );
  43.   else
  44.     view_pcx(  "ANYFRAME.PCX" );
  45.     set_frame( "ANYFRAME.PCX", 10, 10, 10, 10, 0 );
  46.   endif;
  47.  
  48.   loadtext( npc.text ); ! Get the NPC's text block !
  49.   loadvfl ( npc.voice ); ! Get the NPC's voice block !
  50.  
  51.   if NPC.V0 > 0 then
  52.     ! We've spoken before, so don't give the standard greeting..
  53.     pwriteln( "Hello again!  I thought you were gone.." );
  54.   else
  55.     ! First time we talk, so give the standard greeting..
  56.     if not pdotext( "Hello" ) then
  57.       ! If the text block didn't have one, the following would be used..
  58.       pwriteln( "Hello ", player.name, ". What are you up to?" );
  59.     endif;
  60.   endif;
  61.  
  62.   NPC.V0 = 1; ! This variable indicates we've talked before (see above)
  63.  
  64. :CHAT
  65.   L3 = getstr("Name","Join","Bye");
  66.   if L3 = -1 goto CSTOP; 
  67.  
  68. ! Handle JOIN differently..
  69.   if L3 = 1 then 
  70.     if group.size = 6 then
  71.       pwriteln( "Hey! Your party is full! There's no place for me!" );
  72.       goto CHAT;
  73.     endif;
  74.     if npc.level > player.level + 4 then
  75.       ! Normal behaviour would be to decline until adventurer has more
  76.       ! experience, but Jimmy is a friend, so it doesn't apply
  77.       pwriteln( "Ok.  But you are inexperienced, so let me handle the tough" );
  78.       pwriteln( "problems.  You'd better take the better armor too.." );
  79.     endif;
  80.     if npc.level < player.level - 6 then
  81.       ! Normal behaviour would be to decline because the adventurer
  82.       ! has too much experience.  Encounters tend to be more serious
  83.       ! and inexperienced members get killed easily.  Again, since
  84.       ! Jimmy is a friend, we wave the restriction..
  85.       pwriteln( "You mean it?!  I don't have a lot of experience, but I learn" );
  86.       pwriteln( "very fast..  Thanks!" );
  87.     endif;
  88.     if NOT pdotext( "JOIN" ) then
  89.       writeln( "What are we waiting for.. Let's get the weapons!" );
  90.     endif;
  91.     ! Now we might do some animation, so we restore the graphics !
  92.     ! to allow the player to see it !
  93.     if npc.picture >= 0 then
  94.       paint(window); ! Assumes the picture fits in the window !
  95.     endif;
  96.  
  97.     ! If were at the original location, and haven't joined yet.. !
  98.     if npc.v1 = FALSE and npc.x = 6 and npc.y = 7 then
  99.       L1 = 1; ! walk to the right.. !
  100.       for L0 = 1 to 4 do
  101.         gosub MOVEJIMMY;
  102.       endfor;
  103.       L2 = 0;
  104.       L1 = find( object, "Jimmy's Chest", CHEST );
  105.       if success then
  106.         object.index = L1;
  107.         writeln( "I have ", $object.value, " saved from my summer job.." );
  108.         inc( group.gold, object.value );
  109.         vanish(object);
  110.         pause(1); ! Use PAUSE instead of WAIT !
  111.       else
  112.         writeln( "I could have sworn I had some money in here.." );
  113.         inc(L2);
  114.       endif;
  115.       L1 = find( object, "Dwarf's Armor", armor );
  116.       if success then
  117.         object.index = L1;
  118.         writeln( "This Chain Mail is worn, but functional!" );
  119.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  120.       else
  121.         writeln( "My chain mail is missing..  Hmm.." );
  122.         inc(L2);
  123.       endif;
  124.       L1 = find( object, "Dwarf's Axe", weapon );
  125.       if success then
  126.         object.index = L1;
  127.         writeln( "This Axe belonged to my brother..  It's heavy!" );
  128.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  129.       else
  130.         writeln( "Where did I put that Axe?" );
  131.         inc(L2);
  132.       endif;
  133.       if L2 > 0 then
  134.         if L2 = 3 then
  135.           writeln( "I assume you already got my stuff" );
  136.         else
  137.           writeln( "Some of my stuff is missing, I assume you got it?" );
  138.         endif;
  139.         pause(1); ! Use PAUSE instead of WAIT !
  140.       endif;
  141.       L1 = -1; ! Walk to the left.. !
  142.       for L0 = 1 to 4 do
  143.         gosub MOVEJIMMY;
  144.       endfor;
  145.       npc.v1 = TRUE;
  146.     endif;
  147.     JOIN; 
  148.     STOP; ! We are done.. !
  149.  
  150. :MOVEJIMMY ! Subroutine to move jimmy left or right..
  151.     if group.y = npc.y and group.x = npc.x + L1 then
  152.       group.x = npc.x; ! Trade places with the group !
  153.     endif;
  154.     inc( npc.x, L1 );
  155.     pause(1); ! Use PAUSE instead of WAIT !
  156.     return;
  157.  
  158.   endif; ! End of JOIN !
  159.  
  160. ! First, see if the keyword typed is in the character's text block !
  161.   if pdotext( S0 ) then
  162.     if L3 = 2 goto XSTOP; ! BYE !
  163.     goto CHAT;
  164.   endif;
  165.  
  166. ! It didn't, so try the predefined ones..
  167.   on L3 goto CNAME, CJOIN, CSTOP;
  168.  
  169. ! Nope, try a 'DEFAULT' line
  170.   if not pdotext( "DEFAULT" ) then
  171.     pwriteln( "I don't know anything about that!" );
  172.   endif;
  173.   goto CHAT;
  174.  
  175. :CNAME
  176.   pwriteln( "What do you mean, what's my name? Jimmy, of course!" );
  177.   voice( "NAME" );
  178.   GOTO CHAT;
  179.  
  180. :CJOIN
  181.   ! WHAT? Should never happen !
  182.   GOTO CHAT;
  183.  
  184. :CSTOP
  185.   ! BYE was not found in the "text" block for Jimmy !
  186.   pwriteln( "Nice talking to you.." );
  187.   voice( "BYE" ); ! But the voice may be in the RSC file !
  188.   goto XSTOP;
  189.  
  190. ! Feel free to expand on this list.. !
  191.  
  192. !-----------------------------------------------------------------!
  193. ! All STOPs now lead here so the screen can be restored if needed !
  194. !-----------------------------------------------------------------!
  195. :XSTOP
  196.   if npc.picture >= 0 then
  197.     paint(window); ! Assumes the picture fits in the window !
  198.   endif;
  199.   STOP;
  200.  
  201.  
  202.